﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CMS - 后台管理系统</title>
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/resource/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/resource/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <link href="/resource/css/iCheck/all.css" rel="stylesheet" type="text/css" />
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="row">
    <div class="col-md-12">
    	<h1 class="panel-heading">编辑留言</h1>
    </div>
</div>
<section class="panel">	
   <div class="panel-body">
          <div id="baseinfo">
			<form class="col s12" id="form1" th:object="${messageInfo}" th:action="@{/admin/messageInfo/edit}" onsubmit="return validateForm();" method="post">
				<input name="msgId" id="msgId" type="hidden" th:value="*{msgId}" />
				<div class="form-group form-control-medium">
					<label for="msgTitle">留言内容：</label>
					<input id="msgTitle" name="msgTitle" type="text" class="form-control" th:value="*{msgTitle}" placeholder="留言标题">
				</div>
				<div class="form-group form-control-medium">
					<label for="msgContent">留言内容：</label>
					<input id="msgContent" name="msgContent" type="text" class="form-control" th:value="*{msgContent}" placeholder="留言内容">
				</div>
				<div class="form-btn-group-left">
					<button type="submit" class="btn btn-info">保存</button>
				</div>
			</form>
		</div>
   </div>
</section>

<script src="/resource/js/jquery.min.js"></script>
<script src="/resource/js/coco-message/coco-message.js"></script>
<script>
	function validateForm(){
		var msgTitle = $("#msgTitle").val();
		var msgContent = $("#msgContent").val();
		if(msgTitle == null || msgTitle==''){
			cocoMessage.error("留言标题不能为空");
			return false;
		}
		if(msgContent == null || msgContent==''){
			cocoMessage.error("留言内容不能为空");
			return false;
		}
		return true;
	}
</script>
</body>
</html>
